package com.nb.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
//@Component等价于<bean id="user" class="com.nb.pojo.User"/>
@Component
@Scope("singleton")//单例模式 prototype原型模式
public class User {

    public String name ;
    @Value("小明")
    public void setName(String name) {
        this.name = name;
    }
}
